package com.schooleducation.service;

import java.util.List;

import com.schooleducation.entity.Lesson;
import com.schooleducation.entity.LessonSubscribe;
import com.schooleducation.entity.StuDepartment;
import com.schooleducation.entity.StuMajor;
import com.schooleducation.entity.User;
import com.schooleducation.entity.UserInfo;
import com.schooleducation.entity.UserRoles;

/**
 * service层，用户业务操作
 * @author weijing
 *
 */
public interface UserService {

	/**
	 * 登陆
	 * @param u
	 * @return
	 */
	public User doLogin(User u);
	
	/**
	 * 注册
	 * @param u
	 * @return
	 */
	public String doRegist(User u);
	
	/**
	 * 检查昵称是否重复
	 * @param u
	 * @return
	 */
	public boolean isRepeatPetName(User u);
	
	/**
	 * 查询订阅该课程的学生
	 * @param lesson
	 * @return
	 */
	public List<LessonSubscribe> getUserListByLesson(Lesson lesson);
	
	/**
	 * 审核订阅的学生
	 * @param subscribeId
	 * @param state
	 * @return
	 */
	public  boolean auditStudent(int subscribeId, int state);
	
	/**
	 * 查询用户详细信息
	 * @param userId
	 * @return
	 */
	public UserInfo getUserInfo(int userId);
	
	/**
	 * 获取学生系别列表
	 * @return
	 */
	public List<StuDepartment> getStuDepartmentList();
	
	/**
	 * 添加学生系别
	 * @param sd
	 * @return
	 */
	public boolean addStuDepartment(StuDepartment sd);
	
	/**
	 * 更新学生系别
	 * @param sd
	 * @return
	 */
	public boolean updateStuDepartment(StuDepartment sd);
	
	/**
	 * 删除学生系别
	 * @param departmentId
	 * @return
	 */
	public boolean deleteStuDepartment(int departmentId);
	
	/**
	 * 根据系别获取转业列表
	 * @param departmentId
	 * @return
	 */
	public List<StuMajor> getStuMajorListByDepartment(int departmentId);
	
	/**
	 * 添加专业
	 * @param sm
	 * @return
	 */
	public boolean addStuMajor(StuMajor sm);
	
	/**
	 * 跟新专业
	 * @param sm
	 * @return
	 */
	public boolean updateStuMajor(StuMajor sm);
	
	/**
	 * 删除专业
	 * @param majorId
	 * @return
	 */
	public boolean deleteStuMajor(int majorId);
	
	/**
	 * 获取用户列表
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<User> getUserList(int start, int limit);
	
	/**
	 * 获取角色列表
	 * @return
	 */
	public List<UserRoles> getUserRolesList();
	
	/**
	 * 获取用户详细信息及专业
	 * @param userId
	 * @return
	 */
	public UserInfo getUserInfoAndMajorByUserId(int userId);
	
	/**
	 * 更新用户信息
	 * @param u
	 * @return
	 */
	public boolean UpdateUserAndInfo(User u);
	
	/**
	 * 查看单一课程订阅数量
	 * @param l
	 * @return
	 */
	public Long getStudentCountByLesson(Lesson l);
	
	/**
	 * 更改用户角色
	 * @param u
	 * @return
	 */
	public boolean updateUserRoles(User u);
	
	/**
	 * 更改头像
	 * @param u
	 * @return
	 */
	public boolean updateUserLogo(User u);
	
	/**
	 * 更改密码
	 * @param oldUser
	 * @param oldPassword
	 * @param newPassword
	 * @return
	 */
	public boolean changePassword(User oldUser, String oldPassword, String newPassword);
	
}
